import org.wizehack.mri.SFLocalizer;
import org.wizehack.mri.fl.SFLAlgorithm;
import org.wizehack.mri.fl.Tarantula;
import org.wizehack.mri.test.BasicTestCase;
import org.wizehack.mri.test.BasicTestSuite;
import org.wizehack.mri.test.TestCase;
import org.wizehack.mri.test.TestConfigurator;
import org.wizehack.mri.test.TestSuite;


public class Demo extends SFLocalizer{

//	private static String projectName;
	@Override
	public void setUp() {
		String projectName = "GraphEditor";
		String srcCodeLocation = "/home/hsyoun/workspace/jgraphx/src/";
		int numberOfTestSuite = 4;
		int[] numberOfTestCase = {6,6,3,4};
		
		super.createProject(projectName, srcCodeLocation, numberOfTestSuite, numberOfTestCase);
	}

	@Override
	public void registerTestSets() {
		
		TestConfigurator tConf = TestConfigurator.getInstance();
		for(int i=1; i<=tConf.getNumberOfTestSuite(); i++){
			TestSuite ts = new BasicTestSuite();
			
			for(int j=1; j<=tConf.getNumberOfTestCase()[i-1]; j++){
				TestCase tc = new BasicTestCase();
				String coverageFIle = "/home/hsyoun/workspace/jgraphx/Data/" + i + "-" + j + ".xml";
				tc.setCoverageLocation(coverageFIle);
				
				if(i == 1 && j == 3)
					tc.setPassed(false);
				else
					tc.setPassed(true);
				
				ts.add(tc);		
			}
			super.addTestSuite(ts);
		}
		
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Demo demo = new Demo();
		demo.probe();
		SFLAlgorithm sfl = new Tarantula(); 
		demo.debug(sfl);
	}

}
